﻿using System.Windows.Controls;
using System.Windows.Navigation;
using Mal.Balades.Admin.ViewModels;

namespace Mal.Balades.Admin.Views
{
    public partial class Feeds : Page
    {
        #region Fields

        #endregion

        #region Construction / Destruction
        public Feeds()
        {
            InitializeComponent();
        }
        #endregion

        #region enum, struct, class

        #endregion

        #region Properties

        #endregion

        #region Methods

        #endregion

        #region Events
        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (this.DataContext is PageViewModelBase)
            {
                ((PageViewModelBase)this.DataContext).NavigationContext = this.NavigationContext;
                ((PageViewModelBase)this.DataContext).OnNavigate();
            }
        }

        private void OnTextBoxKeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            var bindingExpression = ((TextBox)sender).GetBindingExpression(TextBox.TextProperty);

            if (bindingExpression != null)
            {
                bindingExpression.UpdateSource();
            }
        }
        #endregion
    }
}
